import { useLayoutEffect } from "react";
//主区域滚动时触发时间Hook
export default function (callback) {
  useLayoutEffect(() => {
    let mainContent = document.querySelector(".main-content");
    mainContent.addEventListener("scroll", callback);
    return () => mainContent.removeEventListener("scroll", callback);
  }, [callback]);
}
